//
//  HX_CutomCollectionCell.m
//  UI19 - Car(汽车之家)
//
//  Created by 韩旭 on 16/8/9.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "HX_CutomCollectionCell.h"
#import "HotModel.h"
#import "UIImageView+WebCache.h"
@implementation HX_CutomCollectionCell

- (void)setHotModel:(HotModel *)hotModel {
    _hotModel = hotModel;
    self.lableName.text = hotModel.name;
    [self.imageTitle sd_setImageWithURL:[NSURL URLWithString:hotModel.img] placeholderImage:nil];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        _imageTitle = [[UIImageView alloc] initWithFrame:CGRectZero];
        _imageTitle.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:_imageTitle];
        _lableName = [[UILabel alloc] initWithFrame:CGRectZero];
        _lableName.textAlignment = 1;
        _lableName.font = [UIFont systemFontOfSize:15];
        _lableName.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:_lableName];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    _imageTitle.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height * 0.8);
    _lableName.frame = CGRectMake(0, _imageTitle.frame.size.height, _imageTitle.frame.size.width, self.contentView.frame.size.height * 0.2);
}
@end
